{
open Parser

}

let digit = ['0'-'9']
let id = ['a'-'z'] ['a'-'z' '0'-'9']*

rule mini_ml = parse
| digit+ as  num  { INT(int_of_string num) }
| '+'             { PLUS}
| '-'             { MINUS}
| '*'             { MUL }
| '/'             { DIV }
| '('             { LPAREN}
| ')'             { RPAREN}
| "match"         { MATCH }
| "fn"            { FUN}
| "with"          { WITH}
| "end"           { END}
| '|'             { PIPE}
| "->"            { ARROW}
| "=>"            { FUN_ARROW}
| "let"           { LET}
| "rec"           { REC}
| "in"            { IN}
| "="             { EQ}
| '\n'            { NEW_LINE}
| id as ident     { IDENT ident}
| _               { mini_ml lexbuf}
| eof		  { EOF }



